package top.novel.ui;

import cn.hutool.core.util.StrUtil;
import top.novel.persistence.PersistenceData;
import top.novel.persistence.PersistenceService;

import javax.swing.*;

public class SettingUI {

    private JPanel mainPanel;
    private JPanel settingPanel;
    private JTextField urlTextField;

    public SettingUI() {
        PersistenceData persistenceData = PersistenceService.getInstance().getPersistenceData();
        String state = persistenceData.getUrl();
        if (StrUtil.isNotBlank(state)) {
            urlTextField.setText(state);
        }
    }

    public JComponent getComponent() {
        return mainPanel;
    }

    public JTextField getUrlTextField() {
        return urlTextField;
    }
}
